package com.controller.service;

import org.codehaus.groovy.runtime.powerassert.SourceText;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class IndexService {

    List<EarningMoneyRanking> list = new ArrayList<>();
    private final static Random random = new Random();


    private final static String lastName="赵钱孙李周吴郑王冯陈褚蒋沈韩杨朱秦尤许何吕施张卫皮卞齐康伍余元卜顾孟平黄";

    public List<EarningMoneyRanking> getRandomTopNumber(int topNumber){


        for (int i=0;i<topNumber;i++){
            EarningMoneyRanking money = new EarningMoneyRanking();
            money.setMoney("rmb "+random.nextInt(500000000));
            money.setUserName(lastName.charAt(random.nextInt(lastName.length()))+"");
            list.add(money);
        }

        return list;
    }

    public void test(){
        System.out.println("123123123");
        System.out.println(123123123);
    }
}


class EarningMoneyRanking{
    private String userName;
    private String money;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getMoney() {
        return money;
    }

    public void setMoney(String money) {
        this.money = money;
    }
}